CREATE TABLE [dbo].[TMPRES_SERV]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[CO_NACI] [dbo].[TD_VC_008] NULL,
[CO_ESTA_CIVI] [dbo].[TD_VC_003] NULL,
[CO_NIVE_EDUC] [dbo].[TD_VC_003] NULL,
[CO_TIPO_PRES] [dbo].[TD_VC_003] NULL,
[NU_RUCC_CUAR] [dbo].[TD_VC_020] NULL,
[CO_SITU_EPSS] [dbo].[TD_VC_003] NULL,
[CO_OCUP] [dbo].[TD_VC_008] NULL,
[FE_NACI] [dbo].[TD_DT_001] NULL,
[ST_SEXO] [dbo].[TD_VC_001] NULL,
[CO_UBIC_PANA] [dbo].[TD_VC_006] NULL,
[ST_DISC] [dbo].[TD_VC_001] NULL,
[ST_COND_DOMI] [dbo].[TD_VC_001] NULL,
[FE_BAJA_PRES] [dbo].[TD_DT_001] NULL,
[CO_VIAS] [dbo].[TD_VC_003] NULL,
[NU_VIAS] [dbo].[TD_VC_006] NULL,
[NO_VIAS] [dbo].[TD_VC_020] NULL,
[NU_INTE] [dbo].[TD_VC_006] NULL,
[CO_ZONA] [dbo].[TD_VC_003] NULL,
[NO_ZONA] [dbo].[TD_VC_020] NULL,
[CO_CONV] [dbo].[TD_VC_003] NOT NULL,
[DE_REFE] [dbo].[TD_VC_050] NULL,
[CO_UBIC_GEOG] [dbo].[TD_VC_006] NULL,
[TI_SITU] [dbo].[TD_VC_001] NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPRES_SE__FE_US__744F2D60] DEFAULT (getdate()),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMPRES_SE__CO_US__75435199] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPRES_SE__FE_US__763775D2] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMPRES_SE__CO_US__772B9A0B] DEFAULT (suser_sname())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [PK__TMPRES_S__B5276DB266960AE6] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_PROV]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_CO__09FF42B4] FOREIGN KEY ([CO_CONV]) REFERENCES [dbo].[TTCOEV_DOTR] ([CO_CONV])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_EM__129488B5] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_ES__10AC4043] FOREIGN KEY ([CO_ESTA_CIVI]) REFERENCES [dbo].[TTESCI] ([CO_ESTA_CIVI])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_NA__11A0647C] FOREIGN KEY ([CO_NACI]) REFERENCES [dbo].[TTNACI] ([CO_NACI])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_NI__0FB81C0A] FOREIGN KEY ([CO_NIVE_EDUC]) REFERENCES [dbo].[TTNIVE_EDUC] ([CO_NIVE_EDUC])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_OC__0AF366ED] FOREIGN KEY ([CO_OCUP]) REFERENCES [dbo].[TTOCUP] ([CO_OCUP])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_SI__0DCFD398] FOREIGN KEY ([CO_SITU_EPSS]) REFERENCES [dbo].[TTSITU_EPSS] ([CO_SITU_EPSS])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_TI__0EC3F7D1] FOREIGN KEY ([CO_TIPO_PRES]) REFERENCES [dbo].[TTTIPO_PRES] ([CO_TIPO_PRES])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_VI__0CDBAF5F] FOREIGN KEY ([CO_VIAS]) REFERENCES [dbo].[TTVIAS] ([CO_VIAS])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [FK__TMPRES_SE__CO_ZO__0BE78B26] FOREIGN KEY ([CO_ZONA]) REFERENCES [dbo].[TTZONA_RTPS] ([CO_ZONA])
GO
